"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const taro_1 = require("@tarojs/taro");
const components_1 = require("@tarojs/components");
const prop_types_1 = require("prop-types");
const classnames_1 = require("classnames");
const XDivider_1 = require("../../components/XDivider");
require("./index.scss");
const IMAGE_PREFIX = 'https://clover-mini-program.oss-cn-beijing.aliyuncs.com/';
class default_1 extends taro_1.Component {
    render() {
        const { queryRow, onClick } = this.props;
        return (<components_1.View className={classnames_1.default('card', { 'card-vertical': queryRow.status === 1, 'card-horizontal': queryRow.status === 0 })} onClick={onClick}>
        {queryRow.status === 0
            ?
                <components_1.View style={{ backgroundImage: 'url(' + IMAGE_PREFIX + queryRow.GoodsPrizes[0].cover + ')' }} className="testImg"/>
            :
                queryRow.status === 1
                    ?
                        <components_1.Image src={queryRow.GoodsPrizes[0].cover} className='image' mode='widthFix'/>
                    :
                        null}
        <components_1.View className={classnames_1.default('inner', { 'inner-vertical': queryRow.status === 1, 'inner-horizontal': queryRow.status === 0 })}>
          <components_1.View className='title'>
            {queryRow.GoodsPrizes.map(cell => (<components_1.View className='paragraph' key={cell.id}>
                  <components_1.Text className='text'>{cell.title}</components_1.Text>
                  
                </components_1.View>))}
          </components_1.View>
          <components_1.View className='brief'>
            <components_1.View className='caption'>
              <components_1.Text className='icon'>{queryRow.status === 0 ? '进行中' : '已结束'}</components_1.Text>
              <XDivider_1.default />
              <components_1.Text className='text'>{queryRow.type === 0 ? `参与人数满 ${queryRow.number} 人自动开奖` : queryRow.type === 1 ? `${queryRow.endAt} 自动开奖` : null}</components_1.Text>
            </components_1.View>
            {queryRow.status === 0 && <components_1.Text className='text'>共1人参加</components_1.Text>}
          </components_1.View>
        </components_1.View>
      </components_1.View>);
    }
}
default_1.propTypes = {
    queryRow: prop_types_1.default.object,
    onClick: prop_types_1.default.func
};
default_1.defaultProps = {
    queryRow: {},
    onClick: () => { }
};
exports.default = default_1;
//# sourceMappingURL=index.jsx.map